package com.fpf.springboot.controller;

import java.util.List;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import com.fpf.springboot.domain.Music;
import com.fpf.springboot.service.MusicService;
@RestController
@RequestMapping("music")
public class MusicController {
	@Autowired
	private MusicService musicService;
	
	@RequestMapping("list")
	public List<Music> findAllMusic(){
		List<Music> musics = this.musicService.findAllMusics();
		return musics;
	}
	@RequestMapping("find/{id}")
	public Music findMusicByMusicId(@PathVariable("id") String musicId) {
		return this.musicService.findMusicByMusicId(musicId);
	}
	@RequestMapping("del/{id}")
	public String deleteMusicByMusicId(@PathVariable("id") String musicId) {
		return this.musicService.deleteMusicByMusicId(musicId);
	}
	
}
